<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>活动 - </title>
    <meta name="author" content="wangchunpeng" />
    <meta name="HandheldFriendly" content="True" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <meta http-equiv="cleartype" content="on" />
    <link rel="apple-touch-icon" href="http://img.buding.cn/evite/figure/juba_icon_120.jpg" />
    <link rel="apple-touch-icon-precomposed" href="http://img.buding.cn/evite/figure/juba_icon_120.jpg" />
    <link rel="stylesheet" href="http://juhui.ba/UI/common/icon-font.css" />
    <link rel="stylesheet" href="http://juhui.ba/UI/common/fontello.css?ver=1.65" />
    <style type="css/text">
        #wrap{visibility: hidden;}
    </style>
    <script type="text/javascript">
        var dataForWeixin={
            appId:'wxe4f8fbe869e81084',
            MsgImg:"http://img.buding.cn/evite/figure/juba_icon_120.jpg",
            TLImg:"http://img.buding.cn/evite/figure/juba_icon_120.jpg",
            link:location.href,
            title:document.title,
            desc:"聚吧是您的活动助手，可以帮助您创建活动、邀请朋友，您和您的朋友们将获得自动的活动时间提醒和内容更新提醒，并可随时查看活动详情和参与人员。",
            callback:function(){}
         };
         var TAP ="mousedown";//暂时避免点透
     //   var TAP = (document.hasOwnProperty("ontouchstart"))?'tap':'mousedown';
    </script>
    <script src="http://juhui.ba/UI/common/js/zepto.js?v=1.1.2"></script>
    <script src="http://juhui.ba/UI/common/js/extend/extend.js"></script>
    <script src="http://juhui.ba/UI/common/js/extend/touch.js"></script>
    <script src="http://juhui.ba/UI/common/js/common.js?v=1.8"></script>
<script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?24d0d0d6d351994256af68dfbf8b62dc";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
</script>
</head>
<body>
    <script type="text/javascript">
      var loading_dom = document.createElement("div");
      with(loading_dom){
        style.width='100%';
        style.height = window.innerHeight+'px';
        loading_dom.style.position ='absolute';
        style.top ='0';
        style.zIndex ='999999';
        style.background ='#ffffff';
        addEventListener('touchstart',function(e){
             e.preventDefault();
         });
            addEventListener('touchmove',function(e){
             e.preventDefault();
         });
            addEventListener('touchend',function(e){
             e.preventDefault();
         });
        innerHTML = "<p style='text-align:center;margin-top:"+(window.innerHeight/2-50)+"px'><span class='icon icon-spinner5' style='font-size:24px;color:#444'></span><br />载入中..</p>";
        }
        document.body.appendChild(loading_dom);
        var loadedpage = function(){
           document.getElementById('wrap').style.visibility='visible';
           loading_dom.style.display = 'none';
           document.body.removeChild(loading_dom);
        };
        window.onload = loadedpage;
    </script>
<link rel="stylesheet" href="http://juhui.ba/UI/style_meeting/meeting.css?ver=1.7" />
<div id="wrap" class="detail-page">
    <article class="event-title" style="background:#a6a6a6" >
        <div class="avatar">
            <img src="http://img.buding.cn/evite/heading/0.jpg" />
        </div>
        <div class="title-cont">
            <div class="title-top">
                <p><small>发起人</small></p>
                <p><span class="icon icon-volume-medium"></span>活动已结束</p>
            </div>
            <div class="title-title">活动</div>
        </div>
    </article>
            <article class='coat'>
            <p class="label"><span class="icon iconnew-detail-detail"></span> 活动详情</p>
            <p id="note" class="result">
                开会            </p>
         </article>
        <article>
        <p class="label"><span class="icon iconnew-detail-time"></span> 活动时间</p>
        <p class="result meetingtime"><label>2015-01-06&nbsp;周二&nbsp;18:00</label>
            <span>活动开始5分钟前提醒大家</span>        </p>
    </article>
      
        <article class='coat'>
            <p class="label"><span class="icon iconnew-detail-address"></span> 活动地点</p>
                        <a href="http://api.map.baidu.com/marker?location=31.265225,121.518926&title=大连路538号&content=上海市&output=html&src=budingweixinjuba">
                <p class="result location">
                   大连路538号                    <span>上海市 </span>
                </p>
            </a>
            <div class="icon icon-play3"></div>
             
         </article>
    
    
    
    
            <div class="content mt10">
                            <button id="join-event">我要参加此活动</button>
                <script type="text/javascript">
                   $(function ($) {
                        $('#join-event').on(TAP,function(){
                                                    Jax.loading();
                            $.post("action/do-meeting.php", {eid:EVENT_ID,action:'attend'}, function(data){
                                if(!isNaN(data)){
                                    alert( "报名成功");
                                    location.reload();
                                }else if(data == 'closed'){
                                    alert("对不起哦~ 该活动已经关闭报名啦~");
                                    Jax.loaded();
                                }else if (data == 'followfirst' ){
                                    Jax.loaded();
                                    Jax.bindMsg("followus");
                                }else{
                                   alert('报名失败, 请稍后再试~');
                                   location.reload();
                                }
                                
                            }, "text");

                                                    
                            
                        });
                    });
                </script>
                    </div>
    
    

    <article>
        <p class="label" style="color:#4d4d4d">分享给朋友</p>
        <div class="result">
            <a id="share2friend" class="shareto"><img  src="http://img.buding.cn/juba/2013/12/02/799024d45847c93ee6d4da4c0a11f78e.png" /></a>
            <a id="share2timeline" class="shareto"><img  src="http://img.buding.cn/juba/2013/12/02/4a9e09c3ffbd8c5c3aab271b01149e69.png" /></a>
            <a href="qr/meeting.php?args=XRr7s1L6VHi76X2RwX49nQ%3D%3D" class="shareto"><img  src="http://img.buding.cn/juba/2013/12/02/576bdae7eb9e507f1b7d69672de61b58.png" /></a>
           <div id="new-meeting" class="router" goto="meeting-action.php">
               <span class="icon iconnew-detail-activity"></span>
               <p>我也要</p>
               <p>发起新活动</p>
           </div>
        </div>
    </article>
   

    <header class="title arrow gray">已报名 <b>2</b> 人 </header>
    <article id="member">
                    <div class="member-avatar" data-uid="ofriljvo9_ClPr4xk1nTd02U_Wgw">
                <span class="transition5m">—</span>                <img class="transition0_5m" src="http://wx.qlogo.cn/mmopen/mqLuZ8LuibEGcN6Mhz4nzibmwApch20GvjR0Ie5dVlicTia2CeN3nuIjgvsjGrtYpO9Wt0bLLoeRANXOEZvUibbc30WW9vq6gQjut/0" />
                <p>永远有多远</p>
            </div>
                    <div class="member-avatar" data-uid="ofriljj7JdSSfiNV8Fezqqa_e1ps">
                <span class="transition5m">—</span>                <img class="transition0_5m" src="http://img.buding.cn/evite/heading/0.jpg" />
                <p></p>
            </div>
            </article>


     
</div>
<img id="followus" class="msglay" src="http://img.buding.cn/juba/2013/12/16/900a495cc9441459694c573a84263692.png" />
<img id="share" class="msglay" src="http://img.buding.cn/juba/2013/12/16/4935afff9137b2847929896f222d040d.png" />
<div id="overlay"></div>
<script type="text/javascript">
var EVENT_ID = '12389';

dataForWeixin.MsgImg = dataForWeixin.TLImg ="http://img.buding.cn/evite/heading/0.jpg";
dataForWeixin.desc = $('p.meetingtime label').text().replace(/\s/, " ") +"\n";// $('.themetime-info span').text().replace(/\s/, "\n") +"\n";
if($('p.location').length > 0 ){
    dataForWeixin.desc+=$('p.location').text().replace(/\s/g, "");
}else if($('p.supplement').length > 0){
    dataForWeixin.desc+=$('p.supplement').text().replace(/\s/g, "");
}

$(function ($) {
    Jax.checking_userinput();
    Jax.listening();
    if($('#note').length > 0){
        var note = $('#note').text();
        var regexp = /((http|ftp|https|file):\/\/([\w\-]+\.)+[\w\-]+(\/[\w\-\.\/?\@\%\!\&=\+\~\:\#\;\,]*)?)/ig;
        if(regexp.test(note)){
            $('#note').after('<div class="icon icon-play3"></div>');
            note = note.replace(regexp,"<a href='$1'>$1</a>");
            $('#note').html(note);
        }
              
    }
    $('#share2friend , #share2timeline').on(TAP,function(){
            Jax.bindMsg("share");
    });
    $('#overlay').on(TAP,function(){
            var domarray = $(".msglay").get();
            var _obj = null;
            for(var i=0;i<domarray.length ;i++){
                if(domarray[i].style.display == "block"){
                    _obj = domarray[i];
                    break;
                }
            }
            if(!_obj){
                return false;
            }
            var overlay_obj =document.getElementById('overlay');
            var obj_way = 0-(parseInt($('#'+_obj.id).height() + 50));

            Jax.slide(_obj,"top",5,50,300,function(){
               Jax.slide(_obj,"top",50,obj_way,300,function(){
                    Jax.slide(overlay_obj,"height",640,0,300,function(){
                       _obj.style.display =  overlay_obj.style.display="none";
                       overlay_obj.style.height="100%";
                    });
                });
            });
    });

    $('#edit-member').on(TAP,function(){
        $this = $(this);
        var status = $this.attr('status'); 
        if(!status){
            $('div.member-avatar span').removeClass('turnon').show();
            $this.attr('status',1).addClass('active').html("完成");
        }else{
            $('div.member-avatar span').hide()
            $this.removeAttr('status').removeClass('active').html("踢飞");    
        }
    });

    $('div.member-avatar span').on(TAP,function(){
        var obj_ava =  $(this).parent('div.member-avatar');
        var username = obj_ava.find('p').text();
        var choice = confirm('您确定要移除 '+username+' ?');
        if(choice){
            obj_ava.find('span').addClass('turnon');
            var uid = obj_ava.attr('data-uid');
            $.post("action/do-meeting.php", {action:'remove',eid:EVENT_ID,uid:uid}, function(result){
              if(result == 'ok'){
                    obj_ava.hide();
                    var ii= parseInt($('div.group-head b').text());
                    $('div.group-head b').text(ii-1);
              }else{
                    alert("网络不稳定 , 请稍后再试");
              }
              obj_ava.find('span').removeClass('turnon');
            }, "text");
        }
    });

    $('#leavemsg').on(TAP,function(){
        var msg = prompt('请输入留言：');
        if($.trim(msg) == '' && msg != null){
            alert("不能输入空白留言");
            return false;
        }
        if(msg != null){
            Jax.loading();
            $.post("action/do-meeting.php", {action:'comment',eid:EVENT_ID,msg:msg}, function(result){
                switch(result){
                    case 'followusfirst':
                        alert('请先在微信公共账号里添加‘聚吧’后才可以评论哦~');
                        break;
                    case 'null':
                        alert('请刷新此页面后再试');
                        break;
                    default:
                        $('p.notice').hide();
                        $("#comment ul").prepend(result);
                }
                Jax.loaded();
                return false;
            }, "text");
        }

    });

    $('#comment li').not('.self').on(TAP,function(){
        var objli = $(this);
        var oid= objli.attr('data-uid');
        var nick_name =  objli.find('p.nickname>b').text();
        var msg = prompt("评论给 "+nick_name+" :",'');
        if(msg == ''){
           alert( "消息不能为空");
           return false;
        }

        if(msg != null){
            Jax.loading();
            $.post("action/do-meeting.php", {action:'comment',eid:EVENT_ID,msg:msg,roid:oid}, function(result){
                    switch(result){
                        case 'followusfirst':
                            alert('请先在微信公共账号里添加‘聚吧’后才可以评论哦~');
                            break;
                        case 'null':
                            alert('请刷新此页面后再试');
                            break;
                        default:
                           $("#comment ul").prepend(result);
                    }
                    Jax.loaded();
                    return false;
                }, "text");
        }
    });
});
</script>
<link rel="stylesheet" href="http://juhui.ba/UI/common/stuff.css?v=1.7" />
<div style="height:40px;width:100%"></div>
<footer>
      <ul id="toolbar"> 
        <li class="icon iconnew-bar-back go-back"></li>
        <li class="icon iconnew-bar-home homeindex"></li>
        <li class="icon iconnew-bar-earth submu">
            <div class="portal router" goto="vote-club.php">
              <span class="icon iconnew-bar-hotvote votecolor"></span>
              <span class="labelname">热门投票</span>
            </div>
            <!--
            <div class="portal router" goto="vote-club.php">
              <span class="icon iconnew-bar-hall meetingcolor"></span>
              <span class="labelname">活动大厅</span>
            </div>
            -->
        </li>
        <li class="icon iconnew-bar-add submu">
            <div class="portal router" goto="shy-words.php">
              <span class="icon iconnew-home-05 shycolor"></span>
              <span class="labelname">写悄悄话</span>
            </div>
            <div class="portal router" goto="shy-picture.php">
              <span class="icon iconnew-home-04 shycolor"></span>
              <span class="labelname">阅后即焚</span>
            </div>
            <div class="portal router" goto="vote-action.php">
              <span class="icon iconnew-home-01 votecolor"></span>
              <span class="labelname">新投票</span>
            </div>
            <div class="portal router" goto="meeting-action.php">
              <span class="icon iconnew-detail-activity meetingcolor"></span>
              <span class="labelname">新活动</span>
            </div>
        </li>
        <li class="icon iconnew-bar-user submu">
            <span class="tips">0</span>
            <div class="portal opposite router" goto="juba-msgbox.php">
              <span class="icon iconnew-detail-reply meetingcolor"></span>
              <span class="labelname">消息盒子</span>
            </div>
            <div class="portal opposite router" goto="vote-mine.php">
              <span class="icon iconnew-bar-myvote votecolor"></span>
              <span class="labelname">我的投票</span>
            </div>
            <div class="portal opposite router" goto="meeting-mine.php">
              <span class="icon iconnew-bar-activitylist meetingcolor"></span>
              <span class="labelname">我的活动</span>
            </div>
           

        </li>
        <li class="icon iconnew-bar-refurbish flush"></li>
      </ul>
 </footer>
 <div id="darkness"></div>
 <div class="notification">
      <div class="window confirm growl">
          <div class="loading icon white">         
              <span class="top"></span>     
              <span class="right"></span>
              <span class="bottom"></span>           
              <span class="left"></span>                
          </div>
      </div>
 </div>
<script type="text/javascript">
    (function(){
           var onBridgeReady=function(){
               WeixinJSBridge.on('menu:share:appmessage', function(argv){
                  WeixinJSBridge.invoke('sendAppMessage',{
                     "appid":dataForWeixin.appId,
                     "img_url":dataForWeixin.MsgImg,
                     "img_width":"120",
                     "img_height":"120",
                     "link":dataForWeixin.link,
                     "desc":dataForWeixin.desc,
                     "title":dataForWeixin.title
                  }, function(res){(dataForWeixin.callback)();});
               });
               
               WeixinJSBridge.on('menu:share:timeline', function(argv){
                  WeixinJSBridge.invoke('shareTimeline',{
                     "img_url":dataForWeixin.TLImg,
                     "img_width":"120",
                     "img_height":"120",
                     "link":dataForWeixin.link,
                     "desc":dataForWeixin.desc,
                     "title":dataForWeixin.title
                  },  function(res){});
                  (dataForWeixin.callback)();
               });
              
               WeixinJSBridge.on('menu:share:weibo', function(argv){
                  WeixinJSBridge.invoke('shareWeibo',{
                     "content":"#聚吧#"+dataForWeixin.title+" "+dataForWeixin.link,
                     "url":dataForWeixin.link,
                     "img_url":dataForWeixin.MsgImg,
                     "pic":dataForWeixin.MsgImg,
                     "img":dataForWeixin.MsgImg
                  }, function(res){(dataForWeixin.callback)();});
               });
               WeixinJSBridge.on('menu:share:facebook', function(argv){
                  WeixinJSBridge.invoke('shareFB',{
                     "img_url":dataForWeixin.TLImg,
                     "img_width":"120",
                     "img_height":"120",
                     "link":dataForWeixin.link,
                     "desc":dataForWeixin.desc,
                     "title":dataForWeixin.title
                  }, function(res){});
                  (dataForWeixin.callback)();
               });
               WeixinJSBridge.call('hideToolbar');
        };
        
        if(document.addEventListener){
           document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
        }else if(document.attachEvent){
           document.attachEvent('WeixinJSBridgeReady'   , onBridgeReady);
           document.attachEvent('onWeixinJSBridgeReady' , onBridgeReady);
        }
  })();
    $(function($){
        var step_bottom_pos = -80;
        var init_bottom_pos = 0;
        function toobar(slt,type,hidedarkness){
          if(type == 1){
            slt.show();
            slt.each(function(i){
                $this = $(this);
                init_bottom_pos=step_bottom_pos-$this.height()*i+(step_bottom_pos/5)*i;
                $this.animate({top:init_bottom_pos},300, 'ease-out');
            });
          }else{
             slt.each(function(i){
                    $this = $(this);
                    init_bottom_pos=step_bottom_pos-$this.height()*i+(step_bottom_pos/4)*i;
                    $this.animate({top:0},300, 'ease-in',function(){
                         slt.hide();
                         if(hidedarkness == 1){
                          setTimeout(function(){
                               $('#darkness').hide();
                          },300);
                          
                         }
                    });
                });

          }

        }
        $('#toolbar>li.submu').on(TAP,function(){
              var tips = false;
              if( $(this).find('span.tips').size() > 0){
                  tips=true;
              }
              $('#toolbar>li').not(this).removeClass('current');
              toobar($('#toolbar>li').not(this).find('.portal'),0,0);
              $('#toolbar>li').find('span.tips').animate({top:'0'},300,'ease-out');
              
              if(!$(this).hasClass('current')){
                  $('#darkness').show();
                  $(this).addClass('current');
                  toobar($(this).find('.portal') ,1 ,1);
                  if(tips){
                    $(this).find('span.tips').animate({top:'-80px'},300,'ease-in');
                  }
              }else{
                  $(this).removeClass('current');
                  toobar($(this).find('.portal'),0,1);
                  if(tips){
                    $(this).find('span.tips').animate({top:'0'},300,'ease-out');
                  }
              }
           
        });
        $('#darkness').on(TAP,function(){
             toobar($('.portal'),0,1);
        });
     
       $('footer').show();
        if(history.length >1){
          $("#toolbar>li.go-back").on(TAP,function(){
                Jax.loading();
                setTimeout(function(){
                  Jax.loaded_delay();
                  history.back(-1);
                },400);
                
          });
        }else{
          
        }

        $("#toolbar>.flush").on(TAP,function(){
            Jax.loading();
             setTimeout(function(){
                Jax.loaded_delay();
                location.reload();
              },400);
        });
        
        $("#toolbar>.homeindex").on(TAP,function(){
            Jax.loading();
            setTimeout(function(){
              Jax.loaded_delay();
              location.href = 'http://juhui.ba';
             },400);
        });

        $.post('action/do-message.php',{action:'count'},function(data){
            var unread = parseInt(data);
            if(unread>0){
              $('span.tips').text(unread).show();
            }
        });
        var sltop = window.scrollY;
        setInterval(function(){
            if((sltop - window.scrollY)<0){
               if($('footer').css('bottom') == '0px'){
                   $("footer").animate({
                         bottom:'-45px'
                    }, 200, 'ease-out');
               }
            }else{
              if((sltop - window.scrollY)>0){
                 if($('footer').css('bottom') == '-45px'){
                    $("footer").animate({
                           bottom:'0'
                      }, 200, 'ease-in');
                 }
              }
            }
            sltop =  window.scrollY;
        },500);
    });
  </script>
</body>
</html>
